package de.fmannan.addbook;

import org.eclipse.ui.application.IWorkbenchConfigurer;
import org.eclipse.ui.application.IWorkbenchWindowConfigurer;
import org.eclipse.ui.application.WorkbenchAdvisor;
import org.eclipse.ui.application.WorkbenchWindowAdvisor;

/**
 * 
 * @author fmannan
 * 
 * a WorkbenchAdvisor tells the Workbench how to behave how to draw, what to
 * draw, etc. In particular, our Application WorkbenchAdvisor identifies two
 * things:
 * <ul>
 * <li>The initial perspective to be shown.</li>
 * <li>The WorkbenchWindowAdvisor to be used.</li>
 * </ul>
 */
public class ApplicationWorkbenchAdvisor extends WorkbenchAdvisor {

	private static final String ID = "de.fmannan.addbook.perspective";

    public WorkbenchWindowAdvisor createWorkbenchWindowAdvisor(IWorkbenchWindowConfigurer configurer) {
        return new ApplicationWorkbenchWindowAdvisor(configurer);
    }

    /**
	 * Identifies the initial perspective (the look) of the application.
	 */
	public String getInitialWindowPerspectiveId() {
		return ID;
	}
	
	/**
	 * Enables to save & restore the location and size of the application
	 * window.
	 */
	public void initialize (IWorkbenchConfigurer configurer) {
		configurer.setSaveAndRestore(false);
	}
}
